import { Random } from "mockjs";

function login(req) {

    const info = JSON.parse(req.body)
    if (info.username === 'admin' && info.password === '123') {
        return {
            success: true,
            username: Random.cname(),
            token: Random.guid(),
            message: 'success'
        }
    } else {
        return {
            success: false,
            username: '',
            token: '',
            message: '输入用户名或密码不正确'
        }
    }

}

export default {
    login
}